#include<bits/stdc++.h>
using namespace std;
long long read()
{
    long long x=0;
    short f=1;
    char c=getchar();
    while(c<'0'||c>'9')
    {
        if(c=='-')
        {
            f*=(-1);
        }
        c=getchar();
    }
    while(c>='0'&&c<='9')
    {
        x=x*10+c-'0';
        c=getchar();
    }
    return x*f;
}
void wit(long long x)
{
    if(x==0)
    {
        return ;
    }
    wit(x/10);
    putchar(x%10+'0');
    return ;
}
void write(long long x,bool edl)
{
    if(x<=0)
    {
        if(x==0)
        {
            putchar('0');
        }else{
            putchar('-');
            wit(x*(-1));
        }
    }else{
        wit(x);
    }
    if(edl)
    {
        putchar('\n');
    }else{
        putchar(' ');
    }
    return ;
}
void test(bool ext)
{
    puts("TEST");
    if(ext)
    {
        exit(0);
    }
    return ;
}
const int N=1e5+5;
int n,a[N];
map<int,int>sot;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int ai,cnt=0,p1=1,p2=2,del=0;
    n=read();
    for(int i=1;i<=n;i++)
    {
        ai=read();
        sot[ai]++;
    }
    for(map<int,int>::iterator it=sot.begin();it!=sot.end();it++)
    {
        for(int j=0;j<(*it).second;j++)
        {
            cnt++;
            a[cnt]=(*it).first;
        }
    }
    while(p2<=n)
    {
        while(p2<=n&&a[p2]<=a[p1])
        {
            p2++;
        }
        if(p2>n)
        {
            break;
        }
        del++;
        p2++;
        p1++;
    }
    write(n-del,true);
    return 0;
}
